﻿using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Language.Intellisense;

namespace pyInt
{
    [Export(typeof(IWpfTextViewConnectionListener))]
    [ContentType("Python")]
    [TextViewRole("Editable")]
    [TextViewRole("Interactive")]
    internal class myHandle : IWpfTextViewConnectionListener
    {
        [Import]
        internal ICompletionBroker completionBroker { get; set; }

        public void SubjectBuffersConnected(Microsoft.VisualStudio.Text.Editor.IWpfTextView textView,
            Microsoft.VisualStudio.Text.Editor.ConnectionReason reason,
            System.Collections.ObjectModel.Collection<ITextBuffer> subjectBuffers)
        {
            textView.TextBuffer.Changed += new Formator(textView, completionBroker).OnTextContentChanged;
        }
        public void SubjectBuffersDisconnected(Microsoft.VisualStudio.Text.Editor.IWpfTextView textView,
           Microsoft.VisualStudio.Text.Editor.ConnectionReason reason,
           System.Collections.ObjectModel.Collection<ITextBuffer> subjectBuffers)
        {
        }
    }

}
